package com.future.hedongjun.mine;

import android.content.Context;

import com.future.baselib.utils.BasePreference;

/**
 * @author jniu
 * @Email niuxiaoqi@hztianque.com
 * @time 2018/11/26
 */
public class MsgPushPreference extends BasePreference {

    private static MsgPushPreference preference;

    private String CAN_PUSH = "can_push";

    private MsgPushPreference(Context context) {
        super(context, "msg_push");
    }

    public synchronized static MsgPushPreference getInstance(Context context) {
        if (preference == null) {
            preference = new MsgPushPreference(context.getApplicationContext());
        }
        return preference;
    }

    public void canPush(boolean b) {
        setInt(CAN_PUSH, b ? 0 : 1);
    }

    public boolean canPush() {
        return getInt(CAN_PUSH) == 0;
    }

}
